home *** CD-ROM | disk | FTP | other *** search
- // ArrayOf.cp
- #define ArrayOf_cp
-
- #ifndef ArrayOf_h
- #include "ArrayOf.h"
- #endif
- #ifndef ArrayHeap_h
- #include "ArrayHeap.h"
- #endif
-
- #include <string>
-
- template < class Element >
- uint32 ArrayOf< Element >::operator<<( ConstArrayType r ) const
- {
- Assert( !this->Null() );
- Assert( !r.Null() );
- uint32 amount = this->BoundedLength( r.Length() );
-
- for ( uint32 i = 0; i < amount; i++ )
- (*this)[i] = r[i];
-
- return amount;
- }
-
- template < class Element >
- uint32 ArrayOf< Element >::BitwiseCopy( ConstArrayType r ) const
- {
- Assert( !this->Null() );
- Assert( !r.Null() );
- uint32 amount = this->BoundedLength( r.Length() );
- memcpy( this->Start(), r.Start(), amount );
- //BlockMoveData( r.Start(), Start(), amount );
- return amount;
- }
-
- template < class Element >
- void ArrayOf< Element >::SortBy( Comparison compare ) const
- {
- ArrayHeap<Element> heap( *this, compare );
- heap.Sort();
- }
-